import request from '@/utils/request'
// 文章相关接口
// 获取文章分类
export const getCategory = () => {
  return request.get('/my/cate/list')
}
// 添加文章类别
export const addCategory = (data) => {
  return request.post('/my/cate/add', data)
}
// 获取类别详情
export const getArticleInfo = (id) => {
  return request.get('/my/cate/info', {
    params: { id }
  })
}
// 修改类别详情
export const editArticle = obj => {
  return request.put('/my/cate/info', obj)
}
// 删除类别详情
export const removeArticle = id => {
  return request.delete('/my/cate/del', {
    params: { id }
  })
}
// 文章列表
export const getArticleList = obj => {
  return request.get('/my/article/list', {
    params: {
      pagenum: obj.pagenum,
      pagesize: obj.pagesize
    }
  })
}
// 文章详情
export const getInfo = id => {
  return request.get('/my/article/info', {
    params: { id }
  })
}
// 修改详情
export const editInfo = data => {
  return request.put('/my/article/info', data)
}
// 删除文章
export const removeInfo = id => {
  return request.delete('/my/article/info', {
    params: { id }
  })
}
// 发布文章
export const addArticle = data => {
  return request.post('/my/article/add', data)
}
